import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '零件号',
    align:"center",
    dataIndex: 'avpart'
   },
   {
    title: '零件名',
    align:"center",
    dataIndex: 'avdes1'
   },
   {
    title: '库位',
    align:"center",
    dataIndex: 'stocktype'
   },
   {
    title: 'MAX值',
    align:"center",
    dataIndex: 'v6maxq'
   },
   {
    title: 'MIN值',
    align:"center",
    dataIndex: 'v6minq'
   },
   {
    title: '当前库存',
    align:"center",
    dataIndex: 'bxqtoh'
   },
   {
    title: '警戒颜色',
    align:"center",
    dataIndex: 'color_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
     {
      label: "零件号",
      field: "avpart",
      component: 'Input', //TODO 范围查询
      //colProps: {span: 6},
	},
     {
      label: "零件名",
      field: "avdes1",
      component: 'Input', //TODO 范围查询
      //colProps: {span: 6},
	},
	{
      label: "库位",
      field: 'stocktype',
      component: 'Input',
      //colProps: {span: 6},
 	},
     {
      label: "MAX值",
      field: "v6maxq",
      component: 'JRangeNumber',
      //colProps: {span: 6},
	},
     {
      label: "MIN值",
      field: "v6minq",
      component: 'JRangeNumber',
      //colProps: {span: 6},
	},
     {
      label: "当前库存",
      field: "bxqtoh",
      component: 'JRangeNumber',
      //colProps: {span: 6},
	},
	{
      label: "警戒颜色",
      field: 'color',
      component: 'JSelectMultiple',
      componentProps:{
          dictCode:"red_yello_select"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '零件号',
    field: 'avpart',
    component: 'Input',
  },
  {
    label: '零件名',
    field: 'avdes1',
    component: 'Input',
  },
  {
    label: '库位',
    field: 'stocktype',
    component: 'Input',
  },
  {
    label: 'MAX值',
    field: 'v6maxq',
    component: 'InputNumber',
  },
  {
    label: 'MIN值',
    field: 'v6minq',
    component: 'InputNumber',
  },
  {
    label: '当前库存',
    field: 'bxqtoh',
    component: 'InputNumber',
  },
  {
    label: '警戒颜色',
    field: 'color',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"red_yello_select"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  avpart: {title: '零件号',order: 0,view: 'text', type: 'string',},
  avdes1: {title: '零件名',order: 1,view: 'text', type: 'string',},
  stocktype: {title: '库位',order: 2,view: 'text', type: 'string',},
  v6maxq: {title: 'MAX值',order: 3,view: 'number', type: 'number',},
  v6minq: {title: 'MIN值',order: 4,view: 'number', type: 'number',},
  bxqtoh: {title: '当前库存',order: 5,view: 'number', type: 'number',},
  color: {title: '警戒颜色',order: 6,view: 'list', type: 'string',dictCode: 'red_yello_select',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}